package fc.sj.study.Collector;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/3/3.
 */

public class ActivityCollector {
    public static List<Activity> activities=new ArrayList<>();

    public static void AddActivity(Activity activity){
        activities.add(activity);
    }

    public static void RemoveActivity(Activity activity){
        activities.remove(activity);
    }
    //杀死所有活动
    public static void FinishAllActivity(){
        for (Activity a :activities) {
            if(!a.isFinishing()){
                a.finish();
            }
        }
    }
}
